<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0">
		<title>开具电子发票</title>
		<link href="css/index.css" rel="stylesheet" />
	</head>
	<body>
	<script type="text/javascript" src="js/jquery.min.js" ></script>
	<script src="js/oldPublic.js"></script>
	<script src="js/code.js"></script>
	<script src="js/security.js"></script>
	<div class="wrapTicketinfo" style="overflow-y: scroll;padding-bottom: 1.8rem;box-sizing: border-box;">
		<ul>
			<!--<li>
				<p>武汉天喻信息产业有限公司</p>
				<span>税号：91420000515156415415U</span>
				<small>企业</small>
			</li>
			<li>
				<p>武汉天喻信息产业有限公司</p>
				<small>个人</small>
			</li>-->
		</ul>
		<button class="sure">+ 新增报销凭证报销抬头</button>
	</div>
</body>
<html>

<script>
		var login_name = sessionStorage.getItem('login_name');
		var telphone = sessionStorage.getItem('telphone');
		var orgcode = sessionStorage.getItem('orgcode');
			$('.sure').click(function(){
				window.location.href = './addHead.html';
			})
			$.ajax({
				type:"post",
				url:sessionStorage.getItem('ipconfig'),
				contentType: "application/json;charset=utf-8",
				data:JSON.stringify({data:encryptByDESModeEBC(JSON.stringify({"tag": "9102", 'login_name': login_name, 'telphone':telphone, 'bus_type': '1','orgcode':orgcode }))}),
				success:function(data){
					console.log(data);
					if(data.result=='00'){
						var title_info = JSON.parse(data.title_info);
						var str = '';
						for(var i=0;i<title_info.length;i++){
							var isperson = '';
							var sbh = '';
						
							if(title_info[i].title_type=='0'){
								isperson = '个人';
							}else{
								isperson = '公司';
								sbh = '<span>税号：'+title_info[i].taxpayer_num+'</span>'
							}
							str+='<li onclick = "gotoedit('+title_info[i].title_id+','+title_info[i].title_type+')">'+
									'<p>'+title_info[i].name+'</p>'+sbh+
									'<small>'+isperson+'</small>'+
								'</li>'
						}
						$('ul').html(str);
					}
				}
			});
			function gotoedit(a,b){
				if(b==1){//个人
					window.location.href = './editHeade.html?title_id='+a;
				}else{
					window.location.href = './editHeadeGS.html?title_id='+a;
				}
			}
</script>

